﻿#region Imports
using System;
using System.Collections.ObjectModel;
using System.Globalization;
using System.Windows.Data;
using CommonUtilities.Extensions;
using RequirementLogger.Models;
#endregion

namespace RequirementLogger.Appl.Converters
{
    public class PropertyInfoConverter : IValueConverter
    {
        #region Converter methods
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value.IsNull())
                return new ObservableCollection<Property>();
            else
            {
                return Property.CreateProperties<Apps>((Apps)value).PropertyCollection;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
        #endregion
    }
}
